<template>
    <view v-if="id&&shopId&&shopCate2Id">
        <web-view @message="onMessage" :src="url" />
    </view>
</template>

<script>
export default {
    name: 'ThereAreClassesInTheStoreMasterCopyWebView',

    data() {
        return {
            // url:`https://www.diandianyouke.cn:8080/html/index.html?timestamp=${new Date().getTime()}#id=${this.id}`,
            // url:``,
            id:uni.getStorageSync('business').businessId,
            shopId:uni.getStorageSync('shop')[Number(uni.getStorageSync('index'))].shopId,
            name:uni.getStorageSync('shop')[Number(uni.getStorageSync('index'))].shopName,
            shopCate2Id:uni.getStorageSync('shop')[Number(uni.getStorageSync('index'))].shopCate2Obj.shopCate2Id,
            url: `https://www.diandianyouke.cn:8080/html/index.html?timestamp=${new Date().getTime()}&id=${this.id}&shopId=${this.shopId}&shopCate2Id=${this.shopCate2Id}&name=${this.name}`
        };

        
    },

    mounted() {
        this.url = encodeURI(`https://www.diandianyouke.cn:8080/html/index.html?timestamp=${new Date().getTime()}&id=${this.id}&shopId=${this.shopId}&shopCate2Id=${this.shopCate2Id}&name=${this.name}`)
        console.log(this.shopId);
        console.log(this.name);
        console.log(this.shopCate2Id);
        console.log(this.url);
        this.getNav()
        // this.url =  
    },

    methods: {
        getNav(){
            uni.setNavigationBarTitle({title: '花字设置',})
        },
        onMessage(e){
            console.log(e);
            if(e.id==1) return uni.navigateBack({ delta: 1 })
        }
    },
};
</script>

<style lang="scss" scoped>

</style>